<?php
namespace App\Modules\Sale;

use App\Modules\AdapterApi;
use App\Services\Sale\SaleIndex;

class Sale extends AdapterApi
{

    //添加营业员
    public function addSale(){
        $data = pick_array($this->postData, ['name', 'email', 'phone', 'type']);
        return SaleIndex::Sale()->addSale($data);
    }

    //营业员列表
    public function saleList(){
        return SaleIndex::Sale()->saleList();
    }

    //解绑，离职
    public function updateSale(){
        $data = pick_array($this->postData, ['name', 'email', 'phone', 'type','status','id']);
        return SaleIndex::Sale()->updateSale($data);
    }

    //解绑
    public function unbind(){
        $data = pick_array($this->postData, ['main', 'change_main']);
        return SaleIndex::Sale()->unbind($data);
    }
}